﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using SuperStore.Models;

namespace SuperStore.Controllers
{
    public class CatalogController : SuperStoreController
    {        
        public ActionResult Index(int page = 0)
        {
            ViewData.Add("Pager: Total Pages", (int)Math.Ceiling(Database.Instance.Games.Count / 5f));
            ViewData.Add("Pager: Current Page", page);
            return View(Database.Instance.Games.Skip(page * 5).Take(5));
        }
    }
}
